﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace MMOShared.Packets
{
    [Serializable]
    public class UpdateRequest
    {
        public enum Action { UPDATE_QUERY, DOWNLOAD_REQUEST };
        public Action CurrentAction { get; private set; }
        public UInt16 Version { get; private set; }
        public UpdateRequest(UInt16 version, Action requestAction) { Version = version; CurrentAction = requestAction; }
    }

    [Serializable]
    public class VersionsAvailable
    {
        public UInt16[] AllVersions { get; private set; }
        public UInt16 LatestVersion { get; private set; }
        public VersionsAvailable(UInt16[] versions) { AllVersions = versions; LatestVersion = versions[versions.Length - 1]; }
    }

    [Serializable]
    public class UpdateHeader
    {
        public long TotalSize { get; private set; }
        public int NumberOfFiles { get; private set; }
        public int NumberOfPieces { get; private set; }
        public UpdateHeader(long size, int numFiles, int numPieces) { TotalSize = size; NumberOfFiles = numFiles; NumberOfPieces = numPieces; }
    }
}
